},
activateResult: function(id, params) {
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
- let workspace = params.workspace ? params.workspace.index() : -1;
let event = Clutter.get_current_event();
let modifiers = event ? Shell.get_event_state(event) : 0;
let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
if (openNewWindow)
app.open_new_window(workspace);
else
- app.activate(workspace);
+ app.activate_full(params.workspace, params.timestamp);
},
dragActivateResult: function(id, params) {
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
let app = this._appSys.lookup_app(id);
- app.open_new_window(params.workspace ? params.workspace.index() : -1);
+ app.open_new_window(workspace);
},
createResultActor: function (resultMeta, terms) {
},
activateResult: function(pref, params) {
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
- pref.activate(params.workspace);
+ pref.activate_full(params.workspace, params.timestamp);
},
dragActivateResult: function(pref, params) {
&& this.app.state == Shell.AppState.RUNNING) {
this.app.open_new_window(-1);
} else {
- this.app.activate(-1);
+ this.app.activate();
}
}
Main.overview.hide();
},
shellWorkspaceLaunch : function(params) {
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
- this.app.open_new_window(params.workspace ? params.workspace.index() : -1);
+ this.app.open_new_window(params.workspace);
},
getDragActor: function() {
this.menu.close();
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-datetime-panel.desktop');
- app.activate(-1);
+ app.activate();
},
_onOpenCalendarActivate: function() {
},
activateResult: function(id, params) {
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
let docInfo = this._docManager.lookupByUri(id);
- docInfo.launch(params.workspace ? params.workspace.index() : -1);
+ docInfo.launch(params.workspace);
},
getInitialResultSet: function(terms) {
_onClicked: function() {
this.emit('activate');
- this._app.activate(-1);
+ this._app.activate();
}
};
Signals.addSignalMethods(ListItem.prototype);
// Helper function to translate launch parameters into a GAppLaunchContext
function _makeLaunchContext(params)
{
- params = Params.parse(params, { workspace: null,
- timestamp: null });
+ params = Params.parse(params, { workspace: -1,
+ timestamp: 0 });
let launchContext = global.create_app_launch_context();
- if (params.workspace != null)
- launchContext.set_desktop(params.workspace.index());
- if (params.timestamp != null)
+ if (params.workspace != -1)
+ launchContext.set_desktop(params.workspace);
+ if (params.timestamp != 0)
launchContext.set_timestamp(params.timestamp);
return launchContext;
_onClicked: function() {
this.emit('activate');
- this._app.activate(-1);
+ this._app.activate();
}
};
Signals.addSignalMethods(ListItem.prototype);
_setButtonsForChoices(this, choices);
}
}
-Signals.addSignalMethods(ShellProcessesDialog.prototype);
\ No newline at end of file
+Signals.addSignalMethods(ShellProcessesDialog.prototype);
this.menu.addAction(_("Universal Access Settings"), function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-universal-access-panel.desktop');
- app.activate(-1);
+ app.activate();
});
},
this.menu.addAction(_("Bluetooth Settings"), function() {
Main.overview.hide()
let app = Shell.AppSystem.get_default().lookup_setting('bluetooth-properties.desktop');
- app.activate(-1);
+ app.activate();
});
this._applet.connect('pincode-request', Lang.bind(this, this._pinRequest));
this.menu.addAction(_("Region and Language Settings"), function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-region-panel.desktop');
- app.activate(-1);
+ app.activate();
});
},
this.menu.addAction(_("Network Settings"), function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-network-panel.desktop');
- app.activate(-1);
+ app.activate();
});
this._activeConnections = [ ];
this.menu.addAction(_("Power Settings"),function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-power-panel.desktop');
- app.activate(-1);
+ app.activate();
});
this._proxy.connect('Changed', Lang.bind(this, this._devicesChanged));
this.menu.addAction(_("Sound Settings"), function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-sound-panel.desktop');
- app.activate(-1);
+ app.activate();
});
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
_onMyAccountActivate: function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_setting('gnome-user-accounts-panel.desktop');
- app.activate(-1);
+ app.activate();
},
_onPreferencesActivate: function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_app('gnome-control-center.desktop');
- app.activate(-1);
+ app.activate();
},
_onLockScreenActivate: function() {
time);
return true;
} else if (source.shellWorkspaceLaunch) {
- source.shellWorkspaceLaunch({ workspace: this.metaWorkspace,
+ source.shellWorkspaceLaunch({ workspace: this.metaWorkspace ? this.metaWorkspace.index() : -1,
timestamp: time });
return true;
}
time);
return true;
} else if (source.shellWorkspaceLaunch) {
- source.shellWorkspaceLaunch({ workspace: this.metaWorkspace,
+ source.shellWorkspaceLaunch({ workspace: this.metaWorkspace ? this.metaWorkspace.index() : -1,
timestamp: time });
return true;
}
/**
* shell_app_activate:
* @app: a #ShellApp
+ *
+ * Like shell_app_activate_full(), but using the default workspace and
+ * event timestamp.
+ */
+void
+shell_app_activate (ShellApp *app)
+{
+ return shell_app_activate_full (app, -1, 0);
+}
+
+/**
+ * shell_app_activate_full:
+ * @app: a #ShellApp
* @workspace: launch on this workspace, or -1 for default. Ignored if
* activating an existing window
+ * @timestamp: Event timestamp
*
* Perform an appropriate default action for operating on this application,
* dependent on its current state. For example, if the application is not
* recently used transient for that window).
*/
void
-shell_app_activate (ShellApp *app,
- int workspace)
+shell_app_activate_full (ShellApp *app,
+ int workspace,
+ guint32 timestamp)
{
switch (app->state)
{
{
GError *error = NULL;
if (!shell_app_launch (app,
- 0,
+ timestamp,
NULL,
workspace,
NULL,
case SHELL_APP_STATE_STARTING:
break;
case SHELL_APP_STATE_RUNNING:
- shell_app_activate_window (app, NULL, shell_global_get_current_time (shell_global_get ()));
+ shell_app_activate_window (app, NULL, timestamp);
break;
}
}
void shell_app_activate_window (ShellApp *app, MetaWindow *window, guint32 timestamp);
-void shell_app_activate (ShellApp *app,
- int workspace);
+void shell_app_activate (ShellApp *app);
+
+void shell_app_activate_full (ShellApp *app,
+ int workspace,
+ guint32 timestamp);
void shell_app_open_new_window (ShellApp *app,
int workspace);